import Vue from 'vue'
import VueRouter from 'vue-router'
import EmptyLayout from '@/components//EmptyLayout/EmptyLayout'
Vue.use(VueRouter)


/* Layout */
import Layout from '@/layout'


export const constantRoutes = [

  {
    path: '/',
    component: Layout,
    hidden: true,
    meta: {
      title: '功能',
    },
  },
  {
    path: '/function',
    name: 'function',
    component: Layout,
    meta: {
      title: '功能',
    },
    children: [{
      path: '/function',
      name: 'function',
      component: () => import( /* webpackChunkName: "about" */ '../views/function/index.vue'),
      meta: {
        title: '功能列表',
      },
    },
    {
      path: '/mixins',
      name: '混入(mixins)',
      component: () => import( /* webpackChunkName: "about" */ '../views/function/mixins'),
      meta: {
        title: '混入(mixins)',
      }
    },
    ]
  },
  {
    path: '/components',
    name: 'components',
    component: Layout,
    meta: {
      title: '组件',
    },
    children: [{
      path: '/components',
      name: 'components',
      component: () => import( /* webpackChunkName: "about" */ '../views/components/index.vue'),
      meta: {
        title: '组件列表',
      },
    },]
  },
  {
    path: '/map',
    name: 'map',
    component: Layout,
    meta: {
      title: '地图',
    },
    children: [{
      path: '/arcgis',
      name: 'arcgis',
      component: () => import( /* webpackChunkName: "about" */ '../views/arcgis/index.vue'),
      meta: {
        title: 'arcgis',
      },
    }, {
      path: '/openlayer',
      name: 'openlayer',
      component: () => import( /* webpackChunkName: "about" */ '../views/openlayer/index.vue'),
      meta: {
        title: 'openlayer',
      },
    }, {
      path: '/leaflet',
      name: 'leaflet',
      component: () => import( /* webpackChunkName: "about" */ '../views/leaflet/index.vue'),
      meta: {
        title: 'leaflet',
      },
    }, {
      path: '/threejs',
      name: 'threejs',
      component: () => import( /* webpackChunkName: "about" */ '../views/threejs/index.vue'),
      meta: {
        title: 'threejs',
      },
    }]
  },

  {
    path: '/echarts',
    name: 'echarts',
    component: Layout,
    meta: {
      title: 'echarts',
    },
    children: [{
      path: '/echarts',
      name: 'echarts',
      component: () => import( /* webpackChunkName: "about" */ '../views/echarts/index.vue'),
      meta: {
        title: 'echarts',
      },
    },]
  },

  {
    path: '/db',
    name: 'db',
    component: Layout,
    meta: {
      title: 'db',
    },
    children: [{
      path: '/db',
      name: 'db',
      component: () => import( /* webpackChunkName: "about" */ '../views/db/index.vue'),
      meta: {
        title: '数据库',
      },
    },]
  },

  {
    path: '/html',
    name: 'html',
    component: Layout,
    meta: {
      title: 'html',
    },
    children: [{
      path: '/html',
      name: 'html',
      component: () => import( /* webpackChunkName: "about" */ '../views/html/index.vue'),
      meta: {
        title: 'html',
      },
    },]
  },
  {
    path: '/files',
    name: 'files',
    component: Layout,
    meta: {
      title: '文件操作',
    },
    children: [{
      path: '/files',
      name: '文件操作',
      component: () => import( /* webpackChunkName: "about" */ '../views/files/index.vue'),
      meta: {
        title: '文件操作',
      },
    },]
  },



]
export const asyncRoutes = []
const router = new VueRouter({
  // mode: 'history',
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRoutes
})

export default router